<template>
  <view class="page">
    <view class="page">
      <view class="btn">
        <image
          mode="widthFix"
          class="btn-icon"
          :src="require('@/static/img/search-icon.png')"
        ></image>
        <text class="btn-text">查病虫</text>
      </view>
      <image
        @click="onDiscern"
        class="discern-pic"
        mode="widthFix"
        :src="require('@/static/img/discern-pic.png')"
      ></image>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  onLoad() {},
  methods: {
    onDiscern() {
      uni.chooseImage({
        count: 6, //默认9
        sizeType: ["original", "compressed"], //可以指定是原图还是压缩图，默认二者都有
        sourceType: ["camera", "album"], //从相册选择
        success: function (res) {
          console.log(res.tempFilePaths[0]);
          uni.navigateTo({
            url: "/pages/discern/recognition",
          });
        },
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.page {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #1ac678;
  display: flex;
  justify-content: center;
  align-items: center;
}
.discern-pic {
  width: 468rpx;
  //   height: 468rpx;
}
.btn {
  position: absolute;
  top: 72rpx;
  right: 30rpx;
  width: 207rpx;
  height: 70rpx;
  background: #ffffff;
  border-radius: 53rpx;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  &-text {
    font-size: 26rpx;
    font-weight: 400;
    color: #1ac678;
  }
  &-icon {
    width: 35rpx;
    margin-right: 12rpx;
  }
}
</style>
